package com.shop.shoppingmall.controller;

import com.shop.shoppingmall.entity.ShRecharge;
import com.shop.shoppingmall.service.ShRechargeService;
import com.shop.shoppingmall.util.api.vo.Result;
import org.omg.CORBA.MARSHAL;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * (ShRecharge)表控制层
 *
 * @author makejava
 * @since 2020-11-20 09:54:10
 */
@RestController
@RequestMapping("shRecharge")
@CrossOrigin
public class ShRechargeController {
    /**
     * 服务对象
     */
    @Resource
    private ShRechargeService shRechargeService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据Integer price
     */
    @GetMapping("selectOne")
    public ShRecharge selectOne(String id) {
        return this.shRechargeService.queryById(id);
    }

    /**
     * 开通会员时下订单
     * @param
     * @param
     * @return
     */
    @PostMapping("/selectRechargeByUserId")
    public Result selectRechargeByUserId(HttpServletRequest request){
        //Integer price = (Integer) map.get("price");
        return shRechargeService.selectRechargeByUserId(request);
    }

}
